package com.leetcode.simple;

import javax.swing.tree.TreeNode;
import java.util.ArrayList;
import java.util.List;

/**
 * 中序遍历二叉树 左节点->根节点->右节点
 *
 * @author Administrator
 */
public class TreeNodeTest {

    private static final int COUNT_BITS = Integer.SIZE - 3;
    private static final int CAPACITY = (1 << COUNT_BITS) - 1;

    public static void main(String[] args) {
        System.out.println(CAPACITY);
        System.out.println(-5783273 & CAPACITY);
    }

    private static void recursive() {
    }

    public List<Integer> inorderTraversal(TreeNode root) {
        List<Integer> res = new ArrayList<>();
        helper(root, res);
        return res;
    }

    public void helper(TreeNode root, List<Integer> res) {
//        if (root != null) {
//            if (root.left != null) {
//                helper(root.left, res);
//            }
//            res.add(root.val);
//            if (root.right != null) {
//                helper(root.right, res);
//            }
//        }
    }
}
